<template>
  <div class="out">
    <div v-if="this.arr.length == 0">正在加载</div>
    <div v-else>
      <i @click="$router.go(-1)" class="iconfont icon-zuojiantou"></i>
      <video :src="arr.video.url" controls autoplay></video>
    </div>
  </div>
</template>

<script>
import getLink from '@/api/getLink.js';

export default {
  created() {
    getLink('/api/ShortVideo/sp').then(ok => {
      this.arr = ok.data.find(Element => Element.id == this.$route.params.id);
    });
  },
  data() {
    return {
      arr: [],
    };
  },
};
</script>

<style lang="less" scoped>
.out {
  width: 100%;
  background-color: black;
  position: relative;
  i {
    position: absolute;
    left: 0;
    top: 0.2rem;
    font-size: 0.6rem;
    color: white;
    z-index: 999;
  }
  video {
    width: 100%;
    height: 100vh;
  }
}
</style>
